<template>
	<view class="page">
		<view class="header" :class="!userNo ? 'bj' : ''">
			<view class="title">极速贷</view>
		</view>
		<view class="content">
			<moneyInfo v-if="userNo" />
			<view class="top" v-if="!userNo">
				<view class="top_text">预估金额(元)</view>
				<view class="line"></view>
				<view class="top_money">52000</view>
			</view>
			<view class="dec">完善信息，马上领钱</view>
			<view class="users">
				<view class="item">
					<text>实名认证</text>
					<text class="headle" :class="{ no: step_fast == 1 }" @click="openView('auth/authentication', step_fast == 1)">
						{{ step_fast > 1 ? '已认证' : '去认证' }}
					</text>
				</view>
				<view class="item">
					<text>基本信息</text>
					<text class="headle" :class="{ no: step_fast == 2 }" @click="openView('financial/information', step_fast == 2)">
						{{ step_fast > 2 ? '已完善' : '去完善' }}
					</text>
				</view>
				<view class="item">
					<text>紧急联系人</text>
					<text class="headle" :class="{ no: step_fast == 3 }" @click="openView('financial/urgency', step_fast == 3)">
						{{ step_fast > 3 ? '已完善' : '去完善' }}
					</text>
				</view>
				<view class="item">
					<text>资质信息</text>
					<text class="headle" :class="{ no: step_fast >= 4 }" @click="openView('financial/replenish', step_fast >= 4)">
						{{ step_fast > 4 ? '修改资料' : '去完善' }}
					</text>
				</view>
			</view>
			<view class="btn headle" @click="next">补充资料，马上领钱</view>
			<view class="fixedView"></view>
		</view>
	</view>
</template>

<script>
import moneyInfo from './components/userNo.vue'
import { getapp } from '@/utils'
export default {
	components: { moneyInfo },
	data() {
		return {
			userNo: true,
			step_fast: getapp('step_fast')
		}
	},
	computed: {},
	watch: {},
	onLoad() {
		this.int()
	},
	onShow() {},
	onReady() {},
	// 方法集合
	methods: {
		openView(url, falg) {
			console.log(falg)
			if (!falg) return
			uni.navigateTo({
				url: `/pages/${url}`
			})
		},
		next() {
			uni.navigateTo({
				url: '/pages/financial/information'
			})
		},
		async int() {
			this.step_fast = await getapp('step_fast')
		}
	},
	onHide() {},
	onUnload() {}
}
</script>
<style lang="scss">
uni-page-head .uni-page-head__title {
	font-weight: bold;
}
.page {
	width: 100vw;
	.dec {
		height: 64rpx;
		background: #fef4df;
		border-radius: 32rpx;
		text-align: center;
		line-height: 64rpx;
		font-size: 32rpx;
		font-family: PingFang SC;
		font-weight: 400;
		color: #f1b941;
		margin-top: 24rpx;
	}
	.users {
		background: #ffffff;
		border-radius: 16rpx;
		margin-top: 24rpx;
		// padding: 0 24rpx;
		.item {
			display: flex;
			align-items: center;
			justify-content: space-between;
			padding: 30rpx 24rpx;
			position: relative;
			&::after {
				position: absolute;
				content: '';
				height: 2rpx;
				width: 93%;
				background: #e4e4e4;
				bottom: 0;
				left: 24rpx;
			}
			&:last-child::after {
				height: 0;
			}
			text:nth-of-type(1) {
				font-size: 28rpx;
				font-family: PingFang SC;
				font-weight: 400;
				color: #464646;
			}
			text:nth-of-type(2) {
				width: 144rpx;
				height: 48rpx;
				background: #d8d8d8;
				line-height: 48rpx;
				text-align: center;
				border-radius: 50rpx;
				font-size: 28rpx;
				font-family: PingFang SC;
				font-weight: 400;
				color: #ffffff;
			}
			.no {
				background: #3478f2 !important;
			}
		}
	}
	.btn {
		height: 92rpx;
		background: linear-gradient(270deg, #0481fe 0%, #40c5fe 100%);
		line-height: 92rpx;
		border-radius: 70rpx;
		text-align: center;
		font-size: 36rpx;
		font-family: PingFang SC;
		font-weight: 400;
		color: #ffffff;
		margin-top: 100rpx;
	}
}
.edgeInsetBottom {
	width: 750rpx;
	height: var(--window-bottom);
}

.fixedView {
	position: fixed;
	width: 750rpx;
	height: 30px;
	bottom: var(--window-bottom);
}
.content {
	padding: 40rpx 32rpx;
}
.top {
	width: 686rpx;
	height: 258rpx;
	background: #0780fe;
	box-shadow: 0px 6px 12px rgba(11, 137, 254, 0.08);
	border-radius: 16px;
	padding: 24rpx;
	color: #ffffff;
	font-family: PingFang SC;
	.top_text {
		font-size: 28rpx;
		font-weight: bold;
		padding-bottom: 16rpx;
	}
	.line {
		margin-top: 5rpx;
		width: 100%;
		height: 1px;
		background-image: linear-gradient(to right, #fff 0%, #fff 50%, transparent 50%);
		background-size: 8px 1px;
		background-repeat: repeat-x;
		margin-bottom: 20rpx;
	}
	.top_money {
		font-size: 88rpx;
		font-family: PingFang SC;
		font-weight: 800;
		line-height: 124rpx;
	}
}
.header {
	position: relative;
	top: 0;
	left: 0;
	width: 100vw;
	padding-top: var(--status-bar-height);
	z-index: 10;
	background-color: #3478f2;
	color: #ffffff;
}
.title {
	height: 44px;
	line-height: 44px;
	font-size: 40rpx;
	font-family: PingFang SC;
	font-weight: bold;
	text-align: center;
}
.bj {
	background-color: #fff;
	color: #000;
}
</style>
